package com.gzhryc.shared_device.oem.code.statistics.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.DateBranchTable;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.enums.DateBranchTableType;

import java.util.Date;

/**
 * 统计中，订单数包含撤销订单数，实际支付额包含撤销金额+退款金额
 */
@DateBranchTable(type = DateBranchTableType.year)
@Table(name = "statistics_place_day")
public class PlaceDayStatistics {

    @PrimaryKey
    @Column(name="day_date",notNull = true,note = "统计日期，格式：yyyyMMdd")
    protected String dayDate;

    @PrimaryKey
    @Column(name = "place_id",notNull = true, note = "网点ID")
    protected Long placeId;

    @Column(name = "place_name", note = "网点名称")
    protected String placeName;

    @Column(name = "place_area_name", note = "网点地区")
    protected String placeAreaName;

    @Column(name="year_num",notNull = true,note = "统计年")
    protected Integer yearNum;

    @Column(name="month_num",notNull = true,note = "统计月")
    protected Integer monthNum;

    @Column(name="day_num",notNull = true,note = "统计日")
    protected Integer dayNum;

    @Column(name="order_count",notNull = true,defVal = "0",note = "订单数")
    protected Integer orderCount;

    @Column(name="order_money",notNull = true,defVal = "0",note = "营业额，单位：厘")
    protected Long orderMoney;

    @Column(name="order_pay_money",notNull = true,defVal = "0",note = "实际支付额，单位：厘")
    protected Long orderPayMoney;

    @Column(name="cancel_order_count",notNull = true,defVal = "0",note = "撤销次数")
    protected Integer cancelOrderCount;

    @Column(name="cancel_order_money",notNull = true,defVal = "0",note = "撤销金额，单位：厘")
    protected Long cancelOrderMoney;

    @Column(name="history_cancel_order_count",notNull = true,defVal = "0",note = "历史撤销次数")
    protected Integer historyCancelOrderCount;

    @Column(name="history_cancel_order_money",notNull = true,defVal = "0",note = "历史撤销金额，单位：厘")
    protected Long historyCancelOrderMoney;

    @Column(name="history_refund_order_count",notNull = true,defVal = "0",note = "历史退款次数")
    protected Integer historyRefundOrderCount;

    @Column(name="history_refund_order_money",notNull = true,defVal = "0",note = "历史退款金额，单位：厘")
    protected Long historyRefundOrderMoney;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    public String getDayDate() {
        return dayDate;
    }

    public void setDayDate(String dayDate) {
        this.dayDate = dayDate;
    }

    public Long getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public String getPlaceAreaName() {
        return placeAreaName;
    }

    public void setPlaceAreaName(String placeAreaName) {
        this.placeAreaName = placeAreaName;
    }

    public Integer getYearNum() {
        return yearNum;
    }

    public void setYearNum(Integer yearNum) {
        this.yearNum = yearNum;
    }

    public Integer getMonthNum() {
        return monthNum;
    }

    public void setMonthNum(Integer monthNum) {
        this.monthNum = monthNum;
    }

    public Integer getDayNum() {
        return dayNum;
    }

    public void setDayNum(Integer dayNum) {
        this.dayNum = dayNum;
    }

    public Integer getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(Integer orderCount) {
        this.orderCount = orderCount;
    }

    public Long getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(Long orderMoney) {
        this.orderMoney = orderMoney;
    }

    public Long getOrderPayMoney() {
        return orderPayMoney;
    }

    public void setOrderPayMoney(Long orderPayMoney) {
        this.orderPayMoney = orderPayMoney;
    }

    public Integer getCancelOrderCount() {
        return cancelOrderCount;
    }

    public void setCancelOrderCount(Integer cancelOrderCount) {
        this.cancelOrderCount = cancelOrderCount;
    }

    public Long getCancelOrderMoney() {
        return cancelOrderMoney;
    }

    public void setCancelOrderMoney(Long cancelOrderMoney) {
        this.cancelOrderMoney = cancelOrderMoney;
    }

    public Integer getHistoryCancelOrderCount() {
        return historyCancelOrderCount;
    }

    public void setHistoryCancelOrderCount(Integer historyCancelOrderCount) {
        this.historyCancelOrderCount = historyCancelOrderCount;
    }

    public Long getHistoryCancelOrderMoney() {
        return historyCancelOrderMoney;
    }

    public void setHistoryCancelOrderMoney(Long historyCancelOrderMoney) {
        this.historyCancelOrderMoney = historyCancelOrderMoney;
    }

    public Integer getHistoryRefundOrderCount() {
        return historyRefundOrderCount;
    }

    public void setHistoryRefundOrderCount(Integer historyRefundOrderCount) {
        this.historyRefundOrderCount = historyRefundOrderCount;
    }

    public Long getHistoryRefundOrderMoney() {
        return historyRefundOrderMoney;
    }

    public void setHistoryRefundOrderMoney(Long historyRefundOrderMoney) {
        this.historyRefundOrderMoney = historyRefundOrderMoney;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getOrderMoneyStr(){
        return NumberTools.getMoneyLiStr(this.orderMoney);
    }

    public String getOrderPayMoneyStr(){
        return NumberTools.getMoneyLiStr(this.orderPayMoney);
    }

    public String getCancelOrderMoneyStr(){
        return NumberTools.getMoneyLiStr(this.cancelOrderMoney);
    }

    public String getHistoryCancelOrderMoneyStr(){
        return NumberTools.getMoneyLiStr(this.historyCancelOrderMoney);
    }

    public String getHistoryRefundOrderMoneyStr(){
        return NumberTools.getMoneyLiStr(this.historyRefundOrderMoney);
    }
}
